# == Schema Information
#
# Table name: base_cities
#
#  id          :integer          not null, primary key
#  name_cn     :string(255)
#  province_id :integer
#  city_type   :integer
#  created_at  :datetime         not null
#  updated_at  :datetime         not null
#

class Base::City < ApplicationRecord

  def to_s
    self.name_cn
  end
  
  def self.options(_province_id)
    return [] if _province_id.to_i==0
    Base::City.where(province_id: _province_id).map{|x|[x.to_s,x.id]}
  end
end
